package servlet;

import com.fasterxml.jackson.databind.ObjectMapper;
import service.Service;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.Reader;

@WebServlet(name = "addCollect", value = "/addCollect")
public class addCollect extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String src = req.getParameter("src");
        String username = req.getParameter("username");
        Service service = new Service();
        service.addCollect(src,username);

    }
}
